/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package gamedsl2.impl;

import gamedsl2.ActorPhysics;
import gamedsl2.Environment;
import gamedsl2.Event;
import gamedsl2.Gamedsl2Package;
import gamedsl2.State;

import java.lang.reflect.InvocationTargetException;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.WrappedException;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>State</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link gamedsl2.impl.StateImpl#getPlayer <em>Player</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getEnvironment <em>Environment</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getGameStateTriggers <em>Game State Triggers</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getId <em>Id</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getName <em>Name</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getBackgroundImage <em>Background Image</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getMoveForce <em>Move Force</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getJumpForce <em>Jump Force</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getMoveUp <em>Move Up</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getMoveDown <em>Move Down</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getMoveLeft <em>Move Left</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getMoveRight <em>Move Right</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getActionButtonA <em>Action Button A</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getActionButtonB <em>Action Button B</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getTilesFile <em>Tiles File</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getMapFile <em>Map File</em>}</li>
 *   <li>{@link gamedsl2.impl.StateImpl#getGameStateSubscribers <em>Game State Subscribers</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class StateImpl extends EObjectImpl implements State {
	/**
	 * The cached value of the '{@link #getPlayer() <em>Player</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPlayer()
	 * @generated
	 * @ordered
	 */
	protected EList<ActorPhysics> player;

	/**
	 * The cached value of the '{@link #getEnvironment() <em>Environment</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEnvironment()
	 * @generated
	 * @ordered
	 */
	protected Environment environment;

	/**
	 * The cached value of the '{@link #getGameStateTriggers() <em>Game State Triggers</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getGameStateTriggers()
	 * @generated
	 * @ordered
	 */
	protected EList<Event> gameStateTriggers;

	/**
	 * The default value of the '{@link #getId() <em>Id</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getId()
	 * @generated
	 * @ordered
	 */
	protected static final int ID_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getId()
	 * @generated
	 * @ordered
	 */
	protected int id = ID_EDEFAULT;

	/**
	 * The default value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected static final String NAME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected String name = NAME_EDEFAULT;

	/**
	 * The default value of the '{@link #getBackgroundImage() <em>Background Image</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBackgroundImage()
	 * @generated
	 * @ordered
	 */
	protected static final String BACKGROUND_IMAGE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getBackgroundImage() <em>Background Image</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBackgroundImage()
	 * @generated
	 * @ordered
	 */
	protected String backgroundImage = BACKGROUND_IMAGE_EDEFAULT;

	/**
	 * The default value of the '{@link #getMoveForce() <em>Move Force</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMoveForce()
	 * @generated
	 * @ordered
	 */
	protected static final float MOVE_FORCE_EDEFAULT = 0.0F;

	/**
	 * The cached value of the '{@link #getMoveForce() <em>Move Force</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMoveForce()
	 * @generated
	 * @ordered
	 */
	protected float moveForce = MOVE_FORCE_EDEFAULT;

	/**
	 * The default value of the '{@link #getJumpForce() <em>Jump Force</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getJumpForce()
	 * @generated
	 * @ordered
	 */
	protected static final float JUMP_FORCE_EDEFAULT = 0.0F;

	/**
	 * The cached value of the '{@link #getJumpForce() <em>Jump Force</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getJumpForce()
	 * @generated
	 * @ordered
	 */
	protected float jumpForce = JUMP_FORCE_EDEFAULT;

	/**
	 * The default value of the '{@link #getMoveUp() <em>Move Up</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMoveUp()
	 * @generated
	 * @ordered
	 */
	protected static final String MOVE_UP_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getMoveUp() <em>Move Up</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMoveUp()
	 * @generated
	 * @ordered
	 */
	protected String moveUp = MOVE_UP_EDEFAULT;

	/**
	 * The default value of the '{@link #getMoveDown() <em>Move Down</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMoveDown()
	 * @generated
	 * @ordered
	 */
	protected static final String MOVE_DOWN_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getMoveDown() <em>Move Down</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMoveDown()
	 * @generated
	 * @ordered
	 */
	protected String moveDown = MOVE_DOWN_EDEFAULT;

	/**
	 * The default value of the '{@link #getMoveLeft() <em>Move Left</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMoveLeft()
	 * @generated
	 * @ordered
	 */
	protected static final String MOVE_LEFT_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getMoveLeft() <em>Move Left</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMoveLeft()
	 * @generated
	 * @ordered
	 */
	protected String moveLeft = MOVE_LEFT_EDEFAULT;

	/**
	 * The default value of the '{@link #getMoveRight() <em>Move Right</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMoveRight()
	 * @generated
	 * @ordered
	 */
	protected static final String MOVE_RIGHT_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getMoveRight() <em>Move Right</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMoveRight()
	 * @generated
	 * @ordered
	 */
	protected String moveRight = MOVE_RIGHT_EDEFAULT;

	/**
	 * The default value of the '{@link #getActionButtonA() <em>Action Button A</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getActionButtonA()
	 * @generated
	 * @ordered
	 */
	protected static final String ACTION_BUTTON_A_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getActionButtonA() <em>Action Button A</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getActionButtonA()
	 * @generated
	 * @ordered
	 */
	protected String actionButtonA = ACTION_BUTTON_A_EDEFAULT;

	/**
	 * The default value of the '{@link #getActionButtonB() <em>Action Button B</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getActionButtonB()
	 * @generated
	 * @ordered
	 */
	protected static final String ACTION_BUTTON_B_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getActionButtonB() <em>Action Button B</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getActionButtonB()
	 * @generated
	 * @ordered
	 */
	protected String actionButtonB = ACTION_BUTTON_B_EDEFAULT;

	/**
	 * The default value of the '{@link #getTilesFile() <em>Tiles File</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTilesFile()
	 * @generated
	 * @ordered
	 */
	protected static final String TILES_FILE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getTilesFile() <em>Tiles File</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTilesFile()
	 * @generated
	 * @ordered
	 */
	protected String tilesFile = TILES_FILE_EDEFAULT;

	/**
	 * The default value of the '{@link #getMapFile() <em>Map File</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMapFile()
	 * @generated
	 * @ordered
	 */
	protected static final String MAP_FILE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getMapFile() <em>Map File</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMapFile()
	 * @generated
	 * @ordered
	 */
	protected String mapFile = MAP_FILE_EDEFAULT;

	/**
	 * The cached value of the '{@link #getGameStateSubscribers() <em>Game State Subscribers</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getGameStateSubscribers()
	 * @generated
	 * @ordered
	 */
	protected EList<Event> gameStateSubscribers;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected StateImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return Gamedsl2Package.Literals.STATE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<ActorPhysics> getPlayer() {
		if (player == null) {
			player = new EObjectWithInverseResolvingEList<ActorPhysics>(ActorPhysics.class, this, Gamedsl2Package.STATE__PLAYER, Gamedsl2Package.ACTOR_PHYSICS__GAME_STATE);
		}
		return player;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Environment getEnvironment() {
		return environment;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetEnvironment(Environment newEnvironment, NotificationChain msgs) {
		Environment oldEnvironment = environment;
		environment = newEnvironment;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__ENVIRONMENT, oldEnvironment, newEnvironment);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setEnvironment(Environment newEnvironment) {
		if (newEnvironment != environment) {
			NotificationChain msgs = null;
			if (environment != null)
				msgs = ((InternalEObject)environment).eInverseRemove(this, Gamedsl2Package.ENVIRONMENT__STATE, Environment.class, msgs);
			if (newEnvironment != null)
				msgs = ((InternalEObject)newEnvironment).eInverseAdd(this, Gamedsl2Package.ENVIRONMENT__STATE, Environment.class, msgs);
			msgs = basicSetEnvironment(newEnvironment, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__ENVIRONMENT, newEnvironment, newEnvironment));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Event> getGameStateTriggers() {
		if (gameStateTriggers == null) {
			gameStateTriggers = new EObjectWithInverseResolvingEList<Event>(Event.class, this, Gamedsl2Package.STATE__GAME_STATE_TRIGGERS, Gamedsl2Package.EVENT__TRIGGER_GAME_STATE);
		}
		return gameStateTriggers;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getId() {
		return id;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setId(int newId) {
		int oldId = id;
		id = newId;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__ID, oldId, id));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
		return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName(String newName) {
		String oldName = name;
		name = newName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__NAME, oldName, name));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getBackgroundImage() {
		return backgroundImage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setBackgroundImage(String newBackgroundImage) {
		String oldBackgroundImage = backgroundImage;
		backgroundImage = newBackgroundImage;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__BACKGROUND_IMAGE, oldBackgroundImage, backgroundImage));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public float getMoveForce() {
		return moveForce;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMoveForce(float newMoveForce) {
		float oldMoveForce = moveForce;
		moveForce = newMoveForce;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__MOVE_FORCE, oldMoveForce, moveForce));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public float getJumpForce() {
		return jumpForce;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setJumpForce(float newJumpForce) {
		float oldJumpForce = jumpForce;
		jumpForce = newJumpForce;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__JUMP_FORCE, oldJumpForce, jumpForce));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getMoveUp() {
		return moveUp;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMoveUp(String newMoveUp) {
		String oldMoveUp = moveUp;
		moveUp = newMoveUp;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__MOVE_UP, oldMoveUp, moveUp));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getMoveDown() {
		return moveDown;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMoveDown(String newMoveDown) {
		String oldMoveDown = moveDown;
		moveDown = newMoveDown;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__MOVE_DOWN, oldMoveDown, moveDown));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getMoveLeft() {
		return moveLeft;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMoveLeft(String newMoveLeft) {
		String oldMoveLeft = moveLeft;
		moveLeft = newMoveLeft;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__MOVE_LEFT, oldMoveLeft, moveLeft));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getMoveRight() {
		return moveRight;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMoveRight(String newMoveRight) {
		String oldMoveRight = moveRight;
		moveRight = newMoveRight;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__MOVE_RIGHT, oldMoveRight, moveRight));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getActionButtonA() {
		return actionButtonA;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setActionButtonA(String newActionButtonA) {
		String oldActionButtonA = actionButtonA;
		actionButtonA = newActionButtonA;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__ACTION_BUTTON_A, oldActionButtonA, actionButtonA));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getActionButtonB() {
		return actionButtonB;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setActionButtonB(String newActionButtonB) {
		String oldActionButtonB = actionButtonB;
		actionButtonB = newActionButtonB;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__ACTION_BUTTON_B, oldActionButtonB, actionButtonB));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getTilesFile() {
		return tilesFile;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTilesFile(String newTilesFile) {
		String oldTilesFile = tilesFile;
		tilesFile = newTilesFile;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__TILES_FILE, oldTilesFile, tilesFile));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getMapFile() {
		return mapFile;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMapFile(String newMapFile) {
		String oldMapFile = mapFile;
		mapFile = newMapFile;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Gamedsl2Package.STATE__MAP_FILE, oldMapFile, mapFile));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Event> getGameStateSubscribers() {
		if (gameStateSubscribers == null) {
			gameStateSubscribers = new EObjectWithInverseResolvingEList.ManyInverse<Event>(Event.class, this, Gamedsl2Package.STATE__GAME_STATE_SUBSCRIBERS, Gamedsl2Package.EVENT__SUBSCRIBER_GAME_STATES);
		}
		return gameStateSubscribers;
	}

	/**
	 * The cached invocation delegate for the '{@link #isSubString(java.lang.String, java.lang.String) <em>Is Sub String</em>}' operation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isSubString(java.lang.String, java.lang.String)
	 * @generated
	 * @ordered
	 */
	protected static final EOperation.Internal.InvocationDelegate IS_SUB_STRING_STRING_STRING__EINVOCATION_DELEGATE = ((EOperation.Internal)Gamedsl2Package.Literals.STATE.getEOperations().get(0)).getInvocationDelegate();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isSubString(String src, String tgt) {
		try {
			return (Boolean)IS_SUB_STRING_STRING_STRING__EINVOCATION_DELEGATE.dynamicInvoke(this, new BasicEList.UnmodifiableEList<Object>(2, new Object[]{src, tgt}));
		}
		catch (InvocationTargetException ite) {
			throw new WrappedException(ite);
		}
	}

	/**
	 * The cached invocation delegate for the '{@link #isValidImageFileType(java.lang.String) <em>Is Valid Image File Type</em>}' operation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isValidImageFileType(java.lang.String)
	 * @generated
	 * @ordered
	 */
	protected static final EOperation.Internal.InvocationDelegate IS_VALID_IMAGE_FILE_TYPE_STRING__EINVOCATION_DELEGATE = ((EOperation.Internal)Gamedsl2Package.Literals.STATE.getEOperations().get(1)).getInvocationDelegate();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isValidImageFileType(String src) {
		try {
			return (Boolean)IS_VALID_IMAGE_FILE_TYPE_STRING__EINVOCATION_DELEGATE.dynamicInvoke(this, new BasicEList.UnmodifiableEList<Object>(1, new Object[]{src}));
		}
		catch (InvocationTargetException ite) {
			throw new WrappedException(ite);
		}
	}

	/**
	 * The cached invocation delegate for the '{@link #isMapImageFileType(java.lang.String) <em>Is Map Image File Type</em>}' operation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isMapImageFileType(java.lang.String)
	 * @generated
	 * @ordered
	 */
	protected static final EOperation.Internal.InvocationDelegate IS_MAP_IMAGE_FILE_TYPE_STRING__EINVOCATION_DELEGATE = ((EOperation.Internal)Gamedsl2Package.Literals.STATE.getEOperations().get(2)).getInvocationDelegate();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isMapImageFileType(String src) {
		try {
			return (Boolean)IS_MAP_IMAGE_FILE_TYPE_STRING__EINVOCATION_DELEGATE.dynamicInvoke(this, new BasicEList.UnmodifiableEList<Object>(1, new Object[]{src}));
		}
		catch (InvocationTargetException ite) {
			throw new WrappedException(ite);
		}
	}

	/**
	 * The cached invocation delegate for the '{@link #isTilesFileType(java.lang.String) <em>Is Tiles File Type</em>}' operation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isTilesFileType(java.lang.String)
	 * @generated
	 * @ordered
	 */
	protected static final EOperation.Internal.InvocationDelegate IS_TILES_FILE_TYPE_STRING__EINVOCATION_DELEGATE = ((EOperation.Internal)Gamedsl2Package.Literals.STATE.getEOperations().get(3)).getInvocationDelegate();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isTilesFileType(String src) {
		try {
			return (Boolean)IS_TILES_FILE_TYPE_STRING__EINVOCATION_DELEGATE.dynamicInvoke(this, new BasicEList.UnmodifiableEList<Object>(1, new Object[]{src}));
		}
		catch (InvocationTargetException ite) {
			throw new WrappedException(ite);
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case Gamedsl2Package.STATE__PLAYER:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getPlayer()).basicAdd(otherEnd, msgs);
			case Gamedsl2Package.STATE__ENVIRONMENT:
				if (environment != null)
					msgs = ((InternalEObject)environment).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Gamedsl2Package.STATE__ENVIRONMENT, null, msgs);
				return basicSetEnvironment((Environment)otherEnd, msgs);
			case Gamedsl2Package.STATE__GAME_STATE_TRIGGERS:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getGameStateTriggers()).basicAdd(otherEnd, msgs);
			case Gamedsl2Package.STATE__GAME_STATE_SUBSCRIBERS:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getGameStateSubscribers()).basicAdd(otherEnd, msgs);
		}
		return super.eInverseAdd(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case Gamedsl2Package.STATE__PLAYER:
				return ((InternalEList<?>)getPlayer()).basicRemove(otherEnd, msgs);
			case Gamedsl2Package.STATE__ENVIRONMENT:
				return basicSetEnvironment(null, msgs);
			case Gamedsl2Package.STATE__GAME_STATE_TRIGGERS:
				return ((InternalEList<?>)getGameStateTriggers()).basicRemove(otherEnd, msgs);
			case Gamedsl2Package.STATE__GAME_STATE_SUBSCRIBERS:
				return ((InternalEList<?>)getGameStateSubscribers()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case Gamedsl2Package.STATE__PLAYER:
				return getPlayer();
			case Gamedsl2Package.STATE__ENVIRONMENT:
				return getEnvironment();
			case Gamedsl2Package.STATE__GAME_STATE_TRIGGERS:
				return getGameStateTriggers();
			case Gamedsl2Package.STATE__ID:
				return getId();
			case Gamedsl2Package.STATE__NAME:
				return getName();
			case Gamedsl2Package.STATE__BACKGROUND_IMAGE:
				return getBackgroundImage();
			case Gamedsl2Package.STATE__MOVE_FORCE:
				return getMoveForce();
			case Gamedsl2Package.STATE__JUMP_FORCE:
				return getJumpForce();
			case Gamedsl2Package.STATE__MOVE_UP:
				return getMoveUp();
			case Gamedsl2Package.STATE__MOVE_DOWN:
				return getMoveDown();
			case Gamedsl2Package.STATE__MOVE_LEFT:
				return getMoveLeft();
			case Gamedsl2Package.STATE__MOVE_RIGHT:
				return getMoveRight();
			case Gamedsl2Package.STATE__ACTION_BUTTON_A:
				return getActionButtonA();
			case Gamedsl2Package.STATE__ACTION_BUTTON_B:
				return getActionButtonB();
			case Gamedsl2Package.STATE__TILES_FILE:
				return getTilesFile();
			case Gamedsl2Package.STATE__MAP_FILE:
				return getMapFile();
			case Gamedsl2Package.STATE__GAME_STATE_SUBSCRIBERS:
				return getGameStateSubscribers();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case Gamedsl2Package.STATE__PLAYER:
				getPlayer().clear();
				getPlayer().addAll((Collection<? extends ActorPhysics>)newValue);
				return;
			case Gamedsl2Package.STATE__ENVIRONMENT:
				setEnvironment((Environment)newValue);
				return;
			case Gamedsl2Package.STATE__GAME_STATE_TRIGGERS:
				getGameStateTriggers().clear();
				getGameStateTriggers().addAll((Collection<? extends Event>)newValue);
				return;
			case Gamedsl2Package.STATE__ID:
				setId((Integer)newValue);
				return;
			case Gamedsl2Package.STATE__NAME:
				setName((String)newValue);
				return;
			case Gamedsl2Package.STATE__BACKGROUND_IMAGE:
				setBackgroundImage((String)newValue);
				return;
			case Gamedsl2Package.STATE__MOVE_FORCE:
				setMoveForce((Float)newValue);
				return;
			case Gamedsl2Package.STATE__JUMP_FORCE:
				setJumpForce((Float)newValue);
				return;
			case Gamedsl2Package.STATE__MOVE_UP:
				setMoveUp((String)newValue);
				return;
			case Gamedsl2Package.STATE__MOVE_DOWN:
				setMoveDown((String)newValue);
				return;
			case Gamedsl2Package.STATE__MOVE_LEFT:
				setMoveLeft((String)newValue);
				return;
			case Gamedsl2Package.STATE__MOVE_RIGHT:
				setMoveRight((String)newValue);
				return;
			case Gamedsl2Package.STATE__ACTION_BUTTON_A:
				setActionButtonA((String)newValue);
				return;
			case Gamedsl2Package.STATE__ACTION_BUTTON_B:
				setActionButtonB((String)newValue);
				return;
			case Gamedsl2Package.STATE__TILES_FILE:
				setTilesFile((String)newValue);
				return;
			case Gamedsl2Package.STATE__MAP_FILE:
				setMapFile((String)newValue);
				return;
			case Gamedsl2Package.STATE__GAME_STATE_SUBSCRIBERS:
				getGameStateSubscribers().clear();
				getGameStateSubscribers().addAll((Collection<? extends Event>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case Gamedsl2Package.STATE__PLAYER:
				getPlayer().clear();
				return;
			case Gamedsl2Package.STATE__ENVIRONMENT:
				setEnvironment((Environment)null);
				return;
			case Gamedsl2Package.STATE__GAME_STATE_TRIGGERS:
				getGameStateTriggers().clear();
				return;
			case Gamedsl2Package.STATE__ID:
				setId(ID_EDEFAULT);
				return;
			case Gamedsl2Package.STATE__NAME:
				setName(NAME_EDEFAULT);
				return;
			case Gamedsl2Package.STATE__BACKGROUND_IMAGE:
				setBackgroundImage(BACKGROUND_IMAGE_EDEFAULT);
				return;
			case Gamedsl2Package.STATE__MOVE_FORCE:
				setMoveForce(MOVE_FORCE_EDEFAULT);
				return;
			case Gamedsl2Package.STATE__JUMP_FORCE:
				setJumpForce(JUMP_FORCE_EDEFAULT);
				return;
			case Gamedsl2Package.STATE__MOVE_UP:
				setMoveUp(MOVE_UP_EDEFAULT);
				return;
			case Gamedsl2Package.STATE__MOVE_DOWN:
				setMoveDown(MOVE_DOWN_EDEFAULT);
				return;
			case Gamedsl2Package.STATE__MOVE_LEFT:
				setMoveLeft(MOVE_LEFT_EDEFAULT);
				return;
			case Gamedsl2Package.STATE__MOVE_RIGHT:
				setMoveRight(MOVE_RIGHT_EDEFAULT);
				return;
			case Gamedsl2Package.STATE__ACTION_BUTTON_A:
				setActionButtonA(ACTION_BUTTON_A_EDEFAULT);
				return;
			case Gamedsl2Package.STATE__ACTION_BUTTON_B:
				setActionButtonB(ACTION_BUTTON_B_EDEFAULT);
				return;
			case Gamedsl2Package.STATE__TILES_FILE:
				setTilesFile(TILES_FILE_EDEFAULT);
				return;
			case Gamedsl2Package.STATE__MAP_FILE:
				setMapFile(MAP_FILE_EDEFAULT);
				return;
			case Gamedsl2Package.STATE__GAME_STATE_SUBSCRIBERS:
				getGameStateSubscribers().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case Gamedsl2Package.STATE__PLAYER:
				return player != null && !player.isEmpty();
			case Gamedsl2Package.STATE__ENVIRONMENT:
				return environment != null;
			case Gamedsl2Package.STATE__GAME_STATE_TRIGGERS:
				return gameStateTriggers != null && !gameStateTriggers.isEmpty();
			case Gamedsl2Package.STATE__ID:
				return id != ID_EDEFAULT;
			case Gamedsl2Package.STATE__NAME:
				return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
			case Gamedsl2Package.STATE__BACKGROUND_IMAGE:
				return BACKGROUND_IMAGE_EDEFAULT == null ? backgroundImage != null : !BACKGROUND_IMAGE_EDEFAULT.equals(backgroundImage);
			case Gamedsl2Package.STATE__MOVE_FORCE:
				return moveForce != MOVE_FORCE_EDEFAULT;
			case Gamedsl2Package.STATE__JUMP_FORCE:
				return jumpForce != JUMP_FORCE_EDEFAULT;
			case Gamedsl2Package.STATE__MOVE_UP:
				return MOVE_UP_EDEFAULT == null ? moveUp != null : !MOVE_UP_EDEFAULT.equals(moveUp);
			case Gamedsl2Package.STATE__MOVE_DOWN:
				return MOVE_DOWN_EDEFAULT == null ? moveDown != null : !MOVE_DOWN_EDEFAULT.equals(moveDown);
			case Gamedsl2Package.STATE__MOVE_LEFT:
				return MOVE_LEFT_EDEFAULT == null ? moveLeft != null : !MOVE_LEFT_EDEFAULT.equals(moveLeft);
			case Gamedsl2Package.STATE__MOVE_RIGHT:
				return MOVE_RIGHT_EDEFAULT == null ? moveRight != null : !MOVE_RIGHT_EDEFAULT.equals(moveRight);
			case Gamedsl2Package.STATE__ACTION_BUTTON_A:
				return ACTION_BUTTON_A_EDEFAULT == null ? actionButtonA != null : !ACTION_BUTTON_A_EDEFAULT.equals(actionButtonA);
			case Gamedsl2Package.STATE__ACTION_BUTTON_B:
				return ACTION_BUTTON_B_EDEFAULT == null ? actionButtonB != null : !ACTION_BUTTON_B_EDEFAULT.equals(actionButtonB);
			case Gamedsl2Package.STATE__TILES_FILE:
				return TILES_FILE_EDEFAULT == null ? tilesFile != null : !TILES_FILE_EDEFAULT.equals(tilesFile);
			case Gamedsl2Package.STATE__MAP_FILE:
				return MAP_FILE_EDEFAULT == null ? mapFile != null : !MAP_FILE_EDEFAULT.equals(mapFile);
			case Gamedsl2Package.STATE__GAME_STATE_SUBSCRIBERS:
				return gameStateSubscribers != null && !gameStateSubscribers.isEmpty();
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (id: ");
		result.append(id);
		result.append(", name: ");
		result.append(name);
		result.append(", backgroundImage: ");
		result.append(backgroundImage);
		result.append(", moveForce: ");
		result.append(moveForce);
		result.append(", jumpForce: ");
		result.append(jumpForce);
		result.append(", moveUp: ");
		result.append(moveUp);
		result.append(", moveDown: ");
		result.append(moveDown);
		result.append(", moveLeft: ");
		result.append(moveLeft);
		result.append(", moveRight: ");
		result.append(moveRight);
		result.append(", actionButtonA: ");
		result.append(actionButtonA);
		result.append(", actionButtonB: ");
		result.append(actionButtonB);
		result.append(", tilesFile: ");
		result.append(tilesFile);
		result.append(", mapFile: ");
		result.append(mapFile);
		result.append(')');
		return result.toString();
	}

} //StateImpl
